package com.aisile.manager.controller;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @标题 LoginController
 * @作者 Mr.chen
 * @创建日期 2018/12/29 16:22
 * @版本号 1.0
 **/
@RestController
@RequestMapping("login")
public class LoginController {
    @RequestMapping("name")
    public Map getLoginName(){
        Map map = new HashMap();
        map.put("name",SecurityContextHolder.getContext()
                .getAuthentication().getName());
        return map;
    }
}
